//
//  Lock_y.swift
//  Library_y
//
//  Created by JC on 2023/6/6.
//

import Foundation
import UIKit

public final class Lock_y { }
extension Lock_y {
    
    // 加锁
    static public func fulfill(object: AnyObject , callBack:()->()){
        print ( " 开始执行 , 加锁 !" )
        objc_sync_enter (object)
        print ( " 执行中 ..." )
        callBack()
        objc_sync_exit (object)
        print ( " 执行完毕 , 解锁 " )
   }
}
